package com.witte.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * @author whiteBe
 *	person : Orders = 1 : n
 *	Order : cart = m : t
 *  
 *usage:
 *1. person be committed lost for buying nothing in 6months.
 *2. revealing people commit latest orders.
 *
 *storage:
 *1.be storing into the remote database(mysql)
 *
 *notice:
 *1.need append sql phase to deal with divided personalized charts
 *
 */
//I design this table doesn't contain order name 
public class Orders {
	
	//must be 'Integer' object,it will enchant 0 for frontUI component without using Integer object.
    private String orderno;

    //buying goods in the same cart will be enchanted the same name
    private Integer ordercode;

    //the unique userId(distinguish users in mysql) of buying this goods
    private Integer customerid;

    //the unique productId(distinguish products in mysql) of buying this goods
    private String productid;

    //records single product money
    private Integer money;

    //records the amount of this product
    private Integer count;

    //the state of this order.
    private String state;
    @JsonFormat(pattern="yyyy-MM-dd")
    //records the time of penetrating this sql into mysql
    private Date addtime;

    public String getOrderno() {
        return orderno;
    }

    public void setOrderno(String orderno) {
        this.orderno = orderno == null ? null : orderno.trim();
    }

    public Integer getOrdercode() {
        return ordercode;
    }

    public void setOrdercode(Integer ordercode) {
        this.ordercode = ordercode;
    }

    public Integer getCustomerid() {
        return customerid;
    }

    public void setCustomerid(Integer customerid) {
        this.customerid = customerid;
    }

    public String getProductid() {
        return productid;
    }

    public void setProductid(String productid) {
        this.productid = productid == null ? null : productid.trim();
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state == null ? null : state.trim();
    }

    public Date getAddtime() {
        return addtime;
    }

    public void setAddtime(Date addtime) {
        this.addtime = addtime;
    }
}